package com.kuang.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @program: springboot-09-test
 * @description:
 * @author: 陈恩涛
 * @create: 2020-11-03 17:39
 **/

@Service
public class AsynService {

    //告诉spring这是一个异步的方法
    @Async
    public void hello(){

        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println("数据正在处理……");
    }
}
